package com.xinpu.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinpu.mapper.SalesOrderMapper;
import com.xinpu.service.SalesOrderService;
import com.xinpu.service.SalesService;
import com.xinpu.vo.SalesOrederVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SalesOrderServiceImpl implements SalesOrderService {
    @Autowired
    private SalesOrderMapper salesOrderMapper;

    /**
     * 订单列表
     *
     * @param salesName
     * @param userName
     * @param orderId
     * @param start
     * @param over
     * @return
     */
    @Override
    public IPage<SalesOrederVo> list(String salesName, String userName, String orderId, String start, String over, Integer page, Integer size, String tenantId) {
        return salesOrderMapper.list(salesName, userName, orderId, start, over, new Page<>(page, size), tenantId);
    }

    @Override
    public SalesOrederVo findById(Integer id) {
        return salesOrderMapper.findById(id);
    }

    @Override
    public IPage<SalesOrederVo> contract(Integer page, Integer size, String name) {
        return salesOrderMapper.contract(new Page<>(page, size), name);
    }
}
